<template>
  <div>
    <div v-for="(item, index) in list" :key="index" @click="tiao(item.id)">
      <van-card
        :price="item.price"
        desc="双11.11限制"
        :title="item.goodsname"
        :thumb="$pre + item.img"
        :origin-price="item.market_price"
      />
    </div>
    <div v-if="list.length == 0">
      <van-empty
        color="#ff9c13"
        description="暂无数据~~去逛逛~~"
        class="custom-image"
      >
        <van-button
          round
          type="danger"
          class="bottom-button"
          color="linear-gradient(to right, #ff9c13, #f87759)"
          >随便逛逛</van-button
        >
      </van-empty>
    </div>
  </div>
</template>

<script>
// import pic from "../assets/img/zanwushuju.png";
export default {
  data() {
    return {
      // pic,
    };
  },
  props: ["list"],
  methods:{
    tiao(id){
      this.$router.push('/detail?id='+id)
    }
  }
};
</script>

<style scoped>
.item {
  padding: 0.2rem;
  margin: 0.2rem;
  border: 0.01rem solid #ccc;
}
.item img {
  width: 1rem;
  height: 1rem;
}
.custom-image .van-empty__image {
  width: 90px;
  height: 90px;
}
</style>
